//
// Created by xinhua on 2021/9/27.
//

#include "Triangle.h"

Triangle::Triangle(const Vector3 &_a, const Vector3 &_b, const Vector3 &_c) {
    type = GET_CLASS(__FILE__);
    name = type + "_" + id;

    this->a = _a;
    this->b = _b;
    this->c = _c;
}

Triangle::~Triangle() {

}

/**
 * 初始化
 */
void Triangle::onInit() {
    BufferGeometry *bufferGeometry = new BufferGeometry();
    bufferGeometry->vertices = {
            a.x, a.y, a.z,
            b.x, b.y, b.z,
            c.x, c.y, c.z
    };
    AxiesBufferGeometry *axiesBufferGeometry = new AxiesBufferGeometry();

    geometries.push_back(bufferGeometry);//由Object3D统一释放内存
    geometries.push_back(axiesBufferGeometry);


    Object3D::onInit();
}
















